#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll mod=1e9+7;
ll n,m,x,y;
string str;
ll f[1009][33][33];
//fijk 第i个数，选的数是j，当前xor为k
void add(ll &xx,ll yy){
	if((xx+=yy)>=mod) xx-=mod;
}
struct Matrix{
	int n,m;
	ll a[4][4];
	Matrix(){ n=m=0; memset(a,0,sizeof(a)); }
}m0,m1,m01,F;
Matrix operator +(Matrix A,Matrix B){
	Matrix C; C.n=C.m=3;
	for(int i=0;i<=3;i++)
		for(int j=0;j<=3;j++)
			C.a[i][j]=A.a[i][j]+B.a[i][j];
	return C;
}
Matrix operator *(Matrix A,Matrix B){
	Matrix C; C.n=C.m=3;
	for(int i=0;i<=3;i++)
		for(int j=0;j<=3;j++)
			for(int k=0;k<=3;k++)
				add(C.a[i][k],A.a[i][j]*B.a[j][k]%mod);
	return C;
}
Matrix qp(Matrix xx,int yy){
	Matrix re;
	re.n=re.m=3;
	for(int i=0;i<=3;i++)
		re.a[i][i]=1;
	while(yy){
		if(yy&1) re=re*xx;
		xx=xx*xx; yy>>=1;
	}
	return re;
}
void solve(){
	m0.a[0][0]=1; m1.a[0][2]=1;
	m0.a[1][1]=1; m1.a[1][3]=1;
	m0.a[2][0]=1; m1.a[2][3]=1;
	m0.a[3][1]=1; m1.a[3][2]=1;
	m0.n=m0.m=m1.n=m1.m=3;
	m01=m0+m1;
	F=qp(m01,x-1);
	if(y==0)
		F=F*m0;
	else
		F=F*m1;
	F=F*qp(m01,n-x);
	cout<<(F.a[0][1]+F.a[0][3])%mod;
	return;
}
int main(){
	freopen("pearl.in","r",stdin);
	freopen("pearl.out","w",stdout);
	std::ios::sync_with_stdio(false);
	cin.tie(0);
	cin>>n>>m>>x>>str;
	m=(1<<m)-1;
	int now=1;
	for(int i=0;i<str.size();i++)
		y=y+(str[i]-'0')*now,now=now*2;
	if(m==1){
		solve();
		return 0;
	}
	if(x==1)
		f[x][y][0]=1;
	else{
		for(int i=0;i<=m;i++)
			f[1][i][0]=1;
	}
	for(int i=2;i<=n;i++)
		for(int j=0;j<=m;j++){
			if(i==x&&j!=y) continue;
			for(int k=0;k<=m;k++){
				for(int lj=0;lj<=m;lj++){
					int lk=k^((lj*j)&m);
					add(f[i][j][k],f[i-1][lj][lk]);
				}
			}
		}
	ll ans=0;
	for(int j=0;j<=m;j++)
		for(int k=0;k<=m;k++)
			add(ans,f[n][j][k]*k%mod);
	cout<<ans;
	return 0;
}